#include "common.h"

#include <assert.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "tests/common_test.h"
#include "util/net.h"

static void test_net_parse_ipv4(void){
    TEST_START_INFO;

    TEST_LINE_REPORT_START;

    char* ip_str="192.168.1.1";
    uint32_t ipv4;
    bool result = false;
    result = net_parse_ipv4(ip_str, &ipv4);
    assert(result);
    assert(3232235777 == ipv4);
    
    result = net_parse_ipv4("1.1.1.1", &ipv4);
    assert(result);
    assert(16843009 == ipv4);

    TEST_END_INFO;
}

int main(int argc, char *argv[]) {
    (void) argc;
    (void) argv;

    test_net_parse_ipv4();

    return 0;
};